﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace QuestionsAnswers.UI.Models
{

    public class Question
    {
        
        public int QuestionId { get; set; }
        public String Text{ get; set; }

        public DateTime DateCreated 
        { 
            get
            {
                return (this.dateCreated == default(DateTime))
                           ? DateTime.Now
                           : this.dateCreated;
            } 
            set { this.dateCreated = value; }
        }
        private DateTime dateCreated = default(DateTime);

        public int UserId { get; set; }
        public int QuestionRating { get; set; }

        // navigation properties
        public virtual User User { get; set; }
     
        public virtual List<Answer> Answers { get; set; }

        public virtual List<Course> Courses { get; set; }

        public virtual List<AssignedToUser> AssignedToUsers { get; set; }

        public virtual List<Tag> Tags { get; set; } 


    }
}